﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
 
using Model;
using IBLL.Controller;
using Model.Controller;
using CenterDateAchieve.Forms;
using IBLL.View;

namespace CenterDateAchieve
{
    public partial class ListDefineForm : EditFormBase, IEditView 
    {
        

        public ListDefineForm()
        {
            InitializeComponent();
        }



        #region IViewForm 成员

        public event EventHandler ExitAction;

        #endregion

        public override void OnAdjustUI(EntityState editStat, IDataTrans data)
        {
            if (editStat == EntityState.Edit)
            {
                this.txt_Code.Enabled = false;
                this.btDelete.Enabled = true;
            }
            else
            {
                this.txt_Code.Enabled =true ;
                this.btDelete.Enabled = false;
            }
        }

        private void btNew_Click(object sender, EventArgs e)
        {
            InvokeCreateAction(sender, e);
        }

        private void btSave_Click(object sender, EventArgs e)
        {
            InvokeSaveAction(sender, e);
        }

        private void btDelete_Click(object sender, EventArgs e)
        {
            InvokeDeleteAction(sender, e);
        }

        private void btExit_Click(object sender, EventArgs e)
        {
            ExitAction(sender, e);
        }

        #region IEditView Members


       

        #endregion
    }
}
